import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  /* 
  {
    title: '所属学校',
    align:"center",
    dataIndex: 'schoolName'
   },
   */
   {
    title: '学生姓名',
    align:"center",
    dataIndex: 'studentName'
   },
   {
    title: '学生手机号',
    align:"center",
    dataIndex: 'bindingPhone'
   },
   {
    title: '设备IMEI',
    align:"center",
    dataIndex: 'imei'
   },
   {
    title: '在线状态',
    align:"center",
    dataIndex: 'onlineStatus',
    slots: { customRender: 'onlineStatusSlot' }
   },
   {
    title: '激活状态',
    align:"center",
    dataIndex: 'activationStatus',
    slots: { customRender: 'activationStatusSlot' }
   },
   {
    title: '使用状态',
    align:"center",
    dataIndex: 'useStatus',
    slots: { customRender: 'useStatusSlot' }
   },
   {
    title: '学生绑定状态',
    align:"center",
    dataIndex: 'bindingStatus',
    slots: { customRender: 'bindingStatusSlot' }
   },
   {
    title: '家长绑定状态',
    align:"center",
    dataIndex: 'parBindingStatus',
    slots: { customRender: 'parBindingStatusSlot' }
   },
   {
    title: '上课免打扰',
    align:"center",
    dataIndex: 'disturbStatus',
    slots: { customRender: 'disturbStatusSlot' }
   },
   {
    title: '激活时间',
    align:"center",
    dataIndex: 'activationTime'
   },
   {
    title: '过期日期',
    align:"center",
    dataIndex: 'expireDate'
   },
   {
    title: '过期状态',
    align:"center",
    dataIndex: 'expireStatus',
    slots: { customRender: 'expireStatusSlot' }
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "学生姓名",
    field: 'studentName',
    component: 'Input',
    //colProps: {span: 6},
 },
	{
      label: "学生手机号",
      field: 'bindingPhones',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "设备IMEI",
      field: 'imeis',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "使用状态",
      field: 'useStatus',
      component: 'JDictSelectTag',
      componentProps: {
        options: [
          { label: '全部', value: '0' },
          { label: '正常', value: '1' },
          { label: '禁用', value: '2' },
        ],
      },
      //colProps: {span: 6},
 	},
	{
      label: "激活状态",
      field: 'activationStatus',
      component: 'JDictSelectTag',
      componentProps: {
        options: [
          { label: '全部', value: '0' },
          { label: '已激活', value: '1' },
          { label: '未激活', value: '2' },
        ],
      },
      //colProps: {span: 6},
 	},
	{
      label: "学生绑定状态",
      field: 'bindingStatus',
      component: 'JDictSelectTag',
      componentProps: {
        options: [
          { label: '全部', value: '0' },
          { label: '已绑定', value: '1' },
          { label: '未绑定', value: '2' },
        ],
      },
      //colProps: {span: 6},
 	},
	{
      label: "在线状态",
      field: 'onlineStatus',
      component: 'JDictSelectTag',
      componentProps: {
        options: [
          { label: '全部', value: '0' },
          { label: '在线', value: '1' },
          { label: '离线', value: '2' },
        ],
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  
  {
    label: 'IMEI码',
    field: 'imei',
    required:true,
    component: 'Input'
  },
  {
    label: '学生手机号',
    field: 'bindingPhone',
    component: 'Input'
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

//表单数据
export const bindCardFormSchema: FormSchema[] = [
  {
    label: 'IMEI码',
    field: 'imei',
    required:true,
    component: 'Input'
  },
  {
    label: '学生',
    field: 'personId',
    component: 'JSelectPerson',
    componentProps:{
      isRadioSelection:true,
	    showButtom:false,
      params:{ignoreEsidCard:true}
    },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请选择要绑定的学生!'},
          ];
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

export const bindParentFormSchema: FormSchema[] = [
  {
    label: 'IMEI号',
    field: 'imei',
    required:true,
    component: 'Input'
  },
  {
    label: '家长手机号',
    field: 'parentPhone',
    component: 'Input'
  }
];

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
